/*
 * test.c
 *
 *  Created on: Dec 14, 2011
 *      Author: sanglei
 */

#include<stdio.h>
#include <stdlib.h>

int sang =0 ;

struct node{
	int i;
	double j;
	int *p;
};

typedef struct{
	int i;
	int j;
}point;

struct{
	int  *i,*j;
	char a[23];
}box1,box3;

struct{
	int i,j;
}box2;

typedef struct{
	char *p;
	int i;
	char a[23];
}strs;

void test6(){
//	strs s={"abc",2,"def"};
//	strs s1={.p="a",.a[0]="a"};
}

void test5(){
	int *p = (int *)malloc(sizeof(int)*4),*q;
	int i;

	q = p;
	for(i=0;i<4;i++){
		*q = i;
		q++;
	}

	for(i =0;i<4;i++){
		printf("%d ",*p++);
	}


}

void test4(int * x){
	*x =1;
}

void test3(){
	point an[2];

	point p,q;
	an[0]=p;
	an[1]=q;

	int i;
	for(i=0;i<2;i++){
		printf("%d,%d\n",an[i].i,an[i].j);
	}


}

void const_test(){
	const int * p = NULL;
	int * const q = NULL;

//	*p = 1;//不能编译成功 read-only
	*q = 1;

	p++;
//	q++;//不能编译成功，read-only
}

void test2()
{
  char *s="Golden Global View";
  char *l="lob";
  char *p;

  p=strstr(s,l);
  if(p)
    printf("%s",p);
  else
    printf("Not Found!");

  getchar();
}

int main_test(){
//	const_test();
//	test2();
//	test3();

//	test5();
	test6();

//	int i = 2;
//	int *p = &i;
//	test4(p);
//	printf("%d",i);
//	struct node Node;//这样定义结构体变量，初始时都是"野值"
	return 0;
}
